var mongoose = require('mongoose');    //引用mongoose模块
var db = mongoose.createConnection('localhost','exapmle1_test1'); //创建一个数据库连接

db.on('error',console.error.bind(console,'连接错误:'));
db.once('open',function(){
    var PersonSchema = new mongoose.Schema({
        name: String
    })

    var PersonModel = db.model('Person', PersonSchema)

    var personEntity = new PersonModel({name: 'hahah'})

    console.log(personEntity.name)

});

